package tk.mybatis.springboot.wexin.Manager;

import tk.mybatis.springboot.wexin.bean.Button;
import tk.mybatis.springboot.wexin.bean.CommonButton;
import tk.mybatis.springboot.wexin.bean.ComplexButton;
import tk.mybatis.springboot.wexin.bean.Menu;



public class MenuManager {
	

    /**
     * 组装菜单数据
     * 展示是虛擬數據，具體數據需要根據業務來。
     * @return
     */
	public static Menu getMenu() {
        CommonButton btn11 = new CommonButton();
        btn11.setName("车险交易");
        btn11.setType("view");
        btn11.setUrl("http://mobile.ydche.com/pub/index");

        CommonButton btn12 = new CommonButton();
        btn12.setName("车险");
        btn12.setType("click");
        btn12.setKey("11");
        
        CommonButton btn21 = new CommonButton();
        btn21.setName("分享收益");
        btn21.setType("view");
        btn21.setKey("k_shareinterest");
        btn21.setUrl("https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx0009e7d7a664484d&redirect_uri=http%3a%2f%2f176k5907u4.imwork.net%2fweixin%2fuser&response_type=code&scope=snsapi_userinfo&state=shareinterest#wechat_redirect ");

        CommonButton btn22 = new CommonButton();
        btn22.setName("资讯广场");
        btn22.setType("view");
        btn22.setUrl("http://176k5907u4.imwork.net/static/eInsurance/newslist.html");

        CommonButton btn23 = new CommonButton();
        btn23.setName("电信福利");
        btn23.setType("view");
        btn23.setKey("k_dianxinfuli");
        btn23.setUrl("https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx0009e7d7a664484d&redirect_uri=http%3a%2f%2f176k5907u4.imwork.net%2fweixin%2fuser&response_type=code&scope=snsapi_userinfo&state=dianxinfuli#wechat_redirect");

        CommonButton btn31 = new CommonButton();
        btn31.setName("APP下载");
        btn31.setType("view");
        btn31.setUrl("http://176k5907u4.imwork.net/static/eInsurance/appdownload.html");
        
//        CommonButton btn32 = new CommonButton();
//        btn32.setName("使用指南");
//        btn32.setType("media_id");
//        btn32.setMedia_id("z0BV12N5j8-mHQHvgikjGdP8fP_SLTHjIxYVe-eaKN0");
//        
//        CommonButton btn33 = new CommonButton();
//        btn33.setName("关于我们");
//        btn33.setType("media_id");
//        btn33.setMedia_id("z0BV12N5j8-mHQHvgikjGV5kqDC-_xARY06BdBqRDnI");

        
        /**
         * 微信：  mainBtn1,mainBtn2,mainBtn3底部的三个一级菜单。
         */
        ComplexButton mainBtn1 = new ComplexButton();
        mainBtn1.setName("活动");
        mainBtn1.setSub_button(new CommonButton[] { btn11,btn12});
        ComplexButton mainBtn2 = new ComplexButton();
        mainBtn2.setName("福利活动");
        mainBtn2.setSub_button(new CommonButton[] { btn23,btn21,btn22 });
        ComplexButton mainBtn3 = new ComplexButton();
        mainBtn3.setName("服务中心");
        mainBtn3.setSub_button(new CommonButton[] { btn31});


        
        /**
         * 封装整个菜单
         */
        Menu menu = new Menu();
        menu.setButton(new Button[] { mainBtn1,mainBtn2,mainBtn3});

        return menu;
    }
}
